package com.framework.design;

import java.util.ArrayList;
import java.util.List;

public class Builder {
	private List<Sender> senderList = new ArrayList<Sender>();

	///
	public List<Sender> produceMailSender(int count) {
		for (int i = 0; i < count; i++) {
			senderList.add(new MailSender());
		}
		return senderList;
	}

	/////
	public List<Sender> produceEmsSender(int count) {
		for (int i = 0; i < count; i++) {
			senderList.add(new EmsSender());
		}
		return senderList;
	}

	public void display(List<Sender> sourceList) {
		List<Sender> targetList = sourceList;
		int i = 0;
		for (Sender sender : targetList) {
			System.out.println("this is " + ++i + "次");
			sender.Send();

		}

	}
}
